﻿using System;
using WiMo.Games.Inputs;
using System.Collections.Generic;

namespace WiMo.Games.StandardInput
{
    public class CharacterBuffer : ICharacterBuffer
    {

        public CharacterBuffer()
        {
            Buffer = new List<char>();
        }

        public List<char> Buffer { get; private set; }

        public string BufferString
        {
            get 
            {
                var str = string.Empty;
                foreach (var ch in Buffer)
                    str += ch;

                return str;
            }            
        }

        public void Add(char ch)
        {
            Buffer.Add(ch);
        }

        public void Clear()
        {
            Buffer.Clear();
        }
    }
}
